<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/axios.min.js"></script>
</head>
<body>
    <div>
        <button onclick="doAxiosGet()">axios.get()...</button>
        <button onclick="doAxiosAjaxPost()">axios.post(...)</button>
    </div>
    <div class="result"></div>
<script>

    function doAxiosAjaxPost(){
        let url = "http://localhost:1314/doPostJSON";
        let params={"msg":"hello axios"};
        axios.post(url,params)
        .then(function(result){
            console.log(result);
            document.querySelector(".result").innerHTML=JSON.stringify(result.data);
        })
        .catch(function(error){
            console.log(error);
        })
    }

    function doAxiosGet(){
        let url = "http://localhost:1314/doGet";
        axios.get(url)
        .then(function(result){
            document.querySelector(".result").innerHTML=result;
        })
        .catch()
    }
</script>
</body>
</html>